# encoding = utf-8
class CreateOrders < ActiveRecord::Migration
  def self.up
    create_table :orders do |t|
      t.integer :deal_id
      t.integer :product_id
      t.integer :number, :default => 1
      t.float :price
      t.integer :discount, :default => 10

      t.timestamps
    end
    
    add_index :orders, :deal_id,                :unique => false
    add_index :orders, :product_id,             :unique => false
  end

  def self.down
    drop_table :orders
  end
end
